from abc import ABCMeta, abstractmethod


class Cache(metaclass=ABCMeta):
    @staticmethod
    @abstractmethod
    def get_attr(key: str) -> str: ...

    @staticmethod
    @abstractmethod
    def set_attr(key: str, val: str) -> None: ...

    @staticmethod
    @abstractmethod
    def delattr(key: str) -> None: ...

    @staticmethod
    @abstractmethod
    def flush_cache() -> None: ...


class CacheImplByLocal(Cache):
    @staticmethod
    def delattr(key: str) -> None:
        del CacheImplByLocal.__cache__[key]

    @staticmethod
    def flush_cache() -> None:
        CacheImplByLocal.__cache__ = {}

    @staticmethod
    def get_attr(key: str) -> str:
        return CacheImplByLocal.__cache__.get(key)

    @staticmethod
    def set_attr(key: str, val: str) -> None:
        CacheImplByLocal.__cache__[key] = val

    __cache__ = {}
